<?php
	require "../dao/staff_dao.php";
	
	$staffname = $_POST["staffname"];
	$staffpass = $_POST["staffpass"];
	
	$staff = selectStaff($staffname, $staffpass);
	
	if($staff){
		session_start();
		$_SESSION['staff'] = $staff;
		header("location:EASystem.php");
	}else{
?>
		<script>
			alert("登陆失败，请输入正确的信息");
			location.href = "S_login_staff.php";
		</script>
<?php
	}
?>